class CreateProfiles < ActiveRecord::Migration
  def self.up
    create_table :profiles, :options => 'ENGINE=InnoDB DEFAULT CHARSET=UTF8' do |t|
      t.column :name, :string
      t.column :location, :string
      t.column :biography, :text
      t.column :user_id,  :integer, :null => false
    end
    
    foreign_key(:profiles, :user_id, :users)
  end
  
  def self.down
    remove_foreign_key(:profiles, :user_id)
    drop_table :profiles
  end
end
